Polymorphism is a means to uniformly handle objects of classes related by inheritance. It allows to send a message to an object without having to know at compile time about the exact class of the receiver. Hence, binding of a message to an implementation of a message has to take place at run time (dynamic binding).

To demonstrate polymorphism, we will give an example:

A communication controller receives data packets with different internal data representation. Assume, for further processing the communication controller needs to transform the data representation of the received packets into a more general representation which is defined by the class unified_packet.

This can be implemented very elegant by application of polymorphism. The communication controller can define a polymorphic object which represents the received data packet:

i: packet'CLASS (Objective VHDL notation)

The transfomation can be done uniformly (without taking care about the different data representations of the received packets) by the invocation of the polymorphic method unify:

i.unify(loc_packet)

loc_packet is an instantiation of class unified_packet